package cn.vcjf.weapp.api.user.mapper;

import cn.vcjf.weapp.api.user.entity.UserDiscount;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhengzihang
 * @since 2018-09-25
 */
public interface UserDiscountMapper extends BaseMapper<UserDiscount> {

	List<UserDiscount> selectUserDiscountList(Page<UserDiscount> page,@Param("userDiscount") UserDiscount userDiscount);

	/**
	 * 修改优惠券状态(0,未使用,1,已使用)
	 * @param userDiscount
	 * @return
	 */
	int updateByUserIdAndDiscountId(UserDiscount userDiscount);

	/**
	 * 修改用户过期的优惠券状态
	 *
	 * @param userDiscount
	 * @return
	 */
	int updateUserDiscountExpire(UserDiscount userDiscount);

}
